<%--
  Created by IntelliJ IDEA.
  User: SYHT
  Date: 2017/8/22
  Time: 10:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="myPage" uri="/xianzhiOA/pageTag" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--解析表达式--%>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <jsp:include page="dist.jsp"/>
</head>
<body style="background-color: #f6f6f6">
<div class="all">
    <jsp:include page="foreEnd.jsp"/>

    <div class="center">
        <jsp:include page="nav.jsp"/>

        <!--内容-->
        <div class="right" id="all_right">

            <form action="${pageContext.request.contextPath}/Postion/updateByPrimaryKeySelective.emp" class="big" method="post">
                <div class="every_top">
                    <h3>招聘中心</h3> <span>公司管理</span> &nbsp;/ &nbsp;<span>职位管理</span>

                </div>

                <div class="rev_content">

                    <div class="rev_in">

                        <%--普通input--%>
                        <div class="rev_every">
                            <span>职位ID：</span>
                            <input type="text" class="rev_input" value="${xzPostion.postionId}"  name="postionId" disabled>
                        </div>
                        <div class="rev_every">
                            <span>公司ID：</span>
                            <input type="text" class="rev_input" value="${xzPostion.companyId}"  name="companyId" disabled>
                        </div>
                        <div class="rev_every">
                            <span>职位名：</span>
                            <input type="text" class="rev_input" value="${xzPostion.postionName}" name="postionName" >
                        </div>
                            <div class="rev_every">
                                <span>职位状态：</span>
                                <input type="text" class="rev_input" value="${xzPostion.postionWelfare}"  name="postionWelfare">
                                0草稿 1审核中 2审核未通过 3正在招聘 4暂停 5结束
                            </div>
                        <div class="rev_every">
                            <span>最低月薪：</span>
                                <input type="text" class="rev_input" value="${xzPostion.postionMm}"  name="postionMm">
                        </div>
                        <div class="rev_every">
                            <span>最高月薪：</span>
                            <input type="text" class="rev_input" value="${xzPostion.postionYm}"  name="postionYm">
                        </div>
                        <div class="rev_every">
                            <span>工作地点：</span>
                            <input type="text" class="rev_input" value="${xzPostion.postionSpace}"  name="postionSpace">
                        </div>
                        <div class="rev_every">
                            <span>刷新时间：</span>
                            <input type="text" class="rev_input" value="<fmt:formatDate value="${xzPostion.postionTime}" pattern="yyy-MM-dd HH:mm:ss" />" name="postionTime">
                        </div>
                        <div class="rev_every">
                            <span>学历要求：</span>
                            <input type="text" class="rev_input" value="${xzPostion.postionEducation}" name="postionEducation">
                        </div>
                        <div class="rev_every">
                            <span>经验要求：</span>
                            <input type="text" class="rev_input" value="${xzPostion.postionExp}"  name="postionExp">
                        </div>
                        <div class="rev_every">
                            <span>年龄要求：</span>
                            <input type="text" class="rev_input" value="${xzPostion.postionAge}"  name="postionAge">
                        </div>
                        <div class="rev_every">
                            <span>创建时间：</span>
                            <input type="text" class="rev_input" value="<fmt:formatDate value="${xzPostion.createTime}" pattern="yyy-MM-dd HH:mm:ss" />" name="createTime">
                        </div>
                        <div class="rev_every">
                            <span>审核时间：</span>
                            <input type="text" class="rev_input" value="<fmt:formatDate value="${xzPostion.deleteTime}" pattern="yyy-MM-dd HH:mm:ss" />" name="deleteTime" >
                        </div>
                        <div class="rev_every">
                            <span>发布时间：</span>
                            <input type="text" class="rev_input" value="<fmt:formatDate value="${xzPostion.publishTime}" pattern="yyy-MM-dd HH:mm:ss" />"  name="publishTime">
                        </div>
                        <div class="rev_every">
                            <span>结束时间：</span>
                            <input type="text" class="rev_input" value="<fmt:formatDate value="${xzPostion.overTime}" pattern="yyy-MM-dd HH:mm:ss" />"  name="overTime">
                        </div>
                        <div class="rev_every">
                            <span>所属部门：</span>
                            <input type="text" class="rev_input" value="${xzPostion.postionDepartment}"  name="postionDepartment">
                        </div>
                        <div class="rev_every">
                            <span>部门人数：</span>
                            <input type="text" class="rev_input" value="${xzPostion.peopleNumber}" name="peopleNumber">
                        </div>
                        <div class="rev_every">
                            <span>专业要求：</span>
                            <input type="text" class="rev_input" value="${xzPostion.postionSpecialty}" name="postionSpecialty" >
                        </div>
                        <div class="rev_every">
                            <span>发布月数：</span>
                            <input type="text" class="rev_input" value="${xzPostion.publishMonth}" name="publishMonth">
                        </div>
                        <div class="rev_every">
                            <span>是否统招：</span>
                            <input type="text" class="rev_input" value="${xzPostion.educationEntrance}"  name="educationEntrance">
                        </div>
                        <div class="rev_every">
                            <span>年龄强制：</span>
                            <input type="text" class="rev_input" value="${xzPostion.forceAge}"  name="forceAge">
                        </div>
                        <div class="rev_every">
                            <span>专业强制：</span>
                            <input type="text" class="rev_input" value="${xzPostion.forceSpecialty}" name="forceSpecialty" >
                        </div>
                        <div class="rev_every">
                            <span style="float: left">未通过原因</span>
                            <textarea class="rev_text" name="filed1">${xzPostion.filed1}</textarea>
                        </div>


                        <div class="rev_every">
                            <span style="float: left">职位描述：</span>
                            <textarea class="rev_text" name="postionDescription">${xzPostion.postionDescription}</textarea>
                        </div>
                        <%----%>

                        <button class="rev_button2" type="submit">提交</button>
                        <button class="rev_button2" type="button" onclick="clo()">关闭</button>
                            <button class="rev_button2" type="button" isAdopt="f" onclick="adopt()" id="adoptP">审核通过</button>
                            <button class="rev_button2 backtan" type="button" >审核未通过</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="backpop" role="alert">
    <div class="backpop_container">
        <div class="allbacktan">
            <span style="float: left">未通过原因：</span><textarea class="pup_text"  id="msgContent"></textarea>
        </div>
        <div>
            <button class="bee_one all_close" type="button" onclick="filed()">确定</button>
            <button class="all_close bee_two">取消</button>
        </div>
        <a href="###" class="all_close tan_close fa fa-remove"></a>
    </div>
</div>
<script src="${pageContext.request.contextPath}/dist/backEnd3/js/tab.js"></script>
<script>
    function clo() {
        this.window.close();
    }
</script>
<script>
    $(function () {
        $('#collapseFour').addClass("panel-collapse collapse in");
        $(".all_center").css("display", "block");     //显示二级导航条
        changeTab5();                               //显示对应二级导航条内容
        $(".center_btn2").css({left: '-50px'});
        $(".center_btn").css({left: '100px'});
        $(".all_center").css({left: '0'});
        $("#all_right").css({left: '110px'});
        isAdopt();
    });
    function adopt() {
        if($('#adoptP').attr("isAdopt")=="f"){
        $.ajax({
            url:"${pageContext.request.contextPath}/Postion/adoptPostion.emp",
            data:{postionId:${xzPostion.postionId}},
            type:"get",
            dataType:"json",
            success:function (data) {
                if(data.msg == "ok"){
                    $('#adoptP').html("审核已通过");
                    $('#adoptP').attr("disabled");
                    pmsg();
                }
            }
        })
        }
    }
    function isAdopt() {
        $.ajax({
            url:"${pageContext.request.contextPath}/Postion/selAdopt.emp",
            data:{postionId:${xzPostion.postionId}},
            type:"get",
            dataType:"json",
            success:function (data) {
                if(data.msg == "ok"){
                    $('#adoptP').attr("isAdopt","t");
                    $('#adoptP').html("审核已通过");
                }else {
                    $('#adoptP').attr("isAdopt","f");
                    $('#adoptP').html("审核通过");
                }
            }
        })
    }
    function pmsg() {
        $.ajax({
            url:"${pageContext.request.contextPath}/xzMsg/postionMsg.emp",
            data:{companyId:'${xzPostion.companyId}',postionName:'${xzPostion.postionName}'},
            type:"get",
            dataType:"json",
            success:function (data) {
                if(data.msg == "ok"){
                    alert("消息发送成功");
                }else {
                    alert("消息发送失败");
                }
            }
        })
    }
    function filed() {
        $.ajax({
            url:"${pageContext.request.contextPath}/Postion/upPostion.emp",
            data:{msgContent:$("#msgContent").val(),companyId:'${xzPostion.companyId}',postionName:'${xzPostion.postionName}',postionId:'${xzPostion.postionId}'},
            type:"get",
            dataType:"json",
            success:function (data) {
                if (data.msg == "ok"){
                    alert("消息发送成功");
                }else {
                    alert("消息发送失败");
                }
            }
        })
    }


</script>
</body>
</html>
